package com.heartware.sh.blackhole.entity;

import android.app.Fragment;

import com.heartware.sh.blackhole.ui.fragment.MyFragment;

/**
 * Created by Administrator on 2018/3/22 0022.
 */

public class FragmentInfo {

    private String title;
    private Class fragment;

    public FragmentInfo(String title, Class fragment) {
        this.title = title;
        this.fragment = fragment;
    }

    public String getTitle() {
        return title;
    }

    public Class getFragment() {
        return fragment;
    }

    public MyFragment getFragmentInstance() throws IllegalAccessException, InstantiationException {


        MyFragment myFragment = (MyFragment) fragment.newInstance();
        myFragment.setType(title);

        return myFragment;
    }
}
